package model

import (
	"time"
)

/*
DB Table Details
-------------------------------------


Table: alipay_agent
[ 0] id                                             INT8                 null: false  primary: true   isArray: false  auto: false  col: INT8            len: -1      default: []
[ 1] app_id                                         VARCHAR(32)          null: false  primary: false  isArray: false  auto: false  col: VARCHAR         len: 32      default: []
[ 2] app_key                                        TEXT                 null: false  primary: false  isArray: false  auto: false  col: TEXT            len: -1      default: []
[ 3] plat_key                                       TEXT                 null: false  primary: false  isArray: false  auto: false  col: TEXT            len: -1      default: []
[ 4] create_time                                    TIMESTAMPTZ          null: false  primary: false  isArray: false  auto: false  col: TIMESTAMPTZ     len: -1      default: []
[ 5] update_time                                    TIMESTAMPTZ          null: false  primary: false  isArray: false  auto: false  col: TIMESTAMPTZ     len: -1      default: []


JSON Sample
-------------------------------------
{    "id": 67,    "app_id": "dTyxlZrDLjxOyiOUTVylIvKBB",    "app_key": "ilLFFGLYHDBmSIfsApSqtIvoW",    "plat_key": "vUfckwGSdmRhPqKfedyOXhUTf",    "create_time": "2128-09-03T08:25:34.798501415+08:00",    "update_time": "2150-08-10T02:26:52.375747+08:00"}



*/

// AlipayAgent struct is a row record of the alipay_agent table in the wxpay database
type AlipayAgent struct {
	//[ 0] id                                             INT8                 null: false  primary: true   isArray: false  auto: false  col: INT8            len: -1      default: []
	ID int64 `gorm:"primary_key;column:id;type:INT8;"`
	//[ 1] app_id                                         VARCHAR(32)          null: false  primary: false  isArray: false  auto: false  col: VARCHAR         len: 32      default: []
	AppID string `gorm:"column:app_id;type:VARCHAR;size:32;"`
	//[ 2] app_key                                        TEXT                 null: false  primary: false  isArray: false  auto: false  col: TEXT            len: -1      default: []
	AppKey string `gorm:"column:app_key;type:TEXT;"`
	//[ 3] plat_key                                       TEXT                 null: false  primary: false  isArray: false  auto: false  col: TEXT            len: -1      default: []
	PlatKey string `gorm:"column:plat_key;type:TEXT;"`
	//[ 4] create_time                                    TIMESTAMPTZ          null: false  primary: false  isArray: false  auto: false  col: TIMESTAMPTZ     len: -1      default: []
	CreateTime time.Time `gorm:"column:create_time;type:TIMESTAMPTZ;"`
	//[ 5] update_time                                    TIMESTAMPTZ          null: false  primary: false  isArray: false  auto: false  col: TIMESTAMPTZ     len: -1      default: []
	UpdateTime time.Time `gorm:"column:update_time;type:TIMESTAMPTZ;"`
}

// TableName sets the insert table name for this struct type
func (a *AlipayAgent) TableName() string {
	return "alipay_agent"
}

// BeforeSave invoked before saving, return an error if field is not populated.
func (a *AlipayAgent) BeforeSave() error {
	return nil
}

// Prepare invoked before saving, can be used to populate fields etc.
func (a *AlipayAgent) Prepare() {
}
